Optimal. Leaf size=221 \[ -\frac {2 \left (3 a^2 A+5 b (A b+2 a B)\right ) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 \left (2 a A b+a^2 B+3 b^2 B\right ) \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {2 \left (3 a^2 A+5 b (A b+2 a B)\right ) \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {2 a (7 A b+5 a B) \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{15 d}+\frac {2 a A \sec ^{\frac {3}{2}}(c+d x) (b+a \sec (c+d x)) \sin (c+d x)}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.25, antiderivative size = 221, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 8, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.242, Rules used = {3039, 4111,
4132, 3853, 3856, 2719, 4131, 2720} \begin {gather*} \frac {2 \left (a^2 B+2 a A b+3 b^2 B\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d}+\frac {2 \left (3 a^2 A+5 b (2 a B+A b)\right ) \sin (c+d x) \sqrt {\sec (c+d x)}}{5 d}-\frac {2 \left (3 a^2 A+5 b (2 a B+A b)\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 a (5 a B+7 A b) \sin (c+d x) \sec ^{\frac {3}{2}}(c+d x)}{15 d}+\frac {2 a A \sin (c+d x) \sec ^{\frac {3}{2}}(c+d x) (a \sec (c+d x)+b)}{5 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2719
Rule 2720
Rule 3039
Rule 3853
Rule 3856
Rule 4111
Rule 4131
Rule 4132
Rubi steps
\begin {align*} \int (a+b \cos (c+d x))^2 (A+B \cos (c+d x)) \sec ^{\frac {7}{2}}(c+d x) \, dx &=\int \sqrt {\sec (c+d x)} (b+a \sec (c+d x))^2 (B+A \sec (c+d x)) \, dx\\ &=\frac {2 a A \sec ^{\frac {3}{2}}(c+d x) (b+a \sec (c+d x)) \sin (c+d x)}{5 d}+\frac {2}{5} \int \sqrt {\sec (c+d x)} \left (\frac {1}{2} b (a A+5 b B)+\frac {1}{2} \left (3 a^2 A+5 b (A b+2 a B)\right ) \sec (c+d x)+\frac {1}{2} a (7 A b+5 a B) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {2 a A \sec ^{\frac {3}{2}}(c+d x) (b+a \sec (c+d x)) \sin (c+d x)}{5 d}+\frac {2}{5} \int \sqrt {\sec (c+d x)} \left (\frac {1}{2} b (a A+5 b B)+\frac {1}{2} a (7 A b+5 a B) \sec ^2(c+d x)\right ) \, dx+\frac {1}{5} \left (3 a^2 A+5 b (A b+2 a B)\right ) \int \sec ^{\frac {3}{2}}(c+d x) \, dx\\ &=\frac {2 \left (3 a^2 A+5 b (A b+2 a B)\right ) \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {2 a (7 A b+5 a B) \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{15 d}+\frac {2 a A \sec ^{\frac {3}{2}}(c+d x) (b+a \sec (c+d x)) \sin (c+d x)}{5 d}+\frac {1}{3} \left (2 a A b+a^2 B+3 b^2 B\right ) \int \sqrt {\sec (c+d x)} \, dx+\frac {1}{5} \left (-3 a^2 A-5 b (A b+2 a B)\right ) \int \frac {1}{\sqrt {\sec (c+d x)}} \, dx\\ &=\frac {2 \left (3 a^2 A+5 b (A b+2 a B)\right ) \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {2 a (7 A b+5 a B) \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{15 d}+\frac {2 a A \sec ^{\frac {3}{2}}(c+d x) (b+a \sec (c+d x)) \sin (c+d x)}{5 d}+\frac {1}{3} \left (\left (2 a A b+a^2 B+3 b^2 B\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx+\frac {1}{5} \left (\left (-3 a^2 A-5 b (A b+2 a B)\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx\\ &=-\frac {2 \left (3 a^2 A+5 b (A b+2 a B)\right ) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 \left (2 a A b+a^2 B+3 b^2 B\right ) \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {2 \left (3 a^2 A+5 b (A b+2 a B)\right ) \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {2 a (7 A b+5 a B) \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{15 d}+\frac {2 a A \sec ^{\frac {3}{2}}(c+d x) (b+a \sec (c+d x)) \sin (c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.63, size = 171, normalized size = 0.77 \begin {gather*} \frac {\sec ^{\frac {5}{2}}(c+d x) \left (-12 \left (3 a^2 A+5 A b^2+10 a b B\right ) \cos ^{\frac {5}{2}}(c+d x) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+20 \left (2 a A b+a^2 B+3 b^2 B\right ) \cos ^{\frac {5}{2}}(c+d x) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )+2 \left (15 \left (a^2 A+A b^2+2 a b B\right )+10 a (2 A b+a B) \cos (c+d x)+3 \left (3 a^2 A+5 A b^2+10 a b B\right ) \cos (2 (c+d x))\right ) \sin (c+d x)\right )}{30 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(722\) vs.
\(2(249)=498\).
time = 0.99, size = 723, normalized size = 3.27
method | result | size |
default | \(-\frac {\sqrt {-\left (-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (\frac {2 B \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{\sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}+2 a \left (2 A b +a B \right ) \left (-\frac {\cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}{6 \left (-\frac {1}{2}+\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{3 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}\right )+\frac {2 b \left (A b +2 a B \right ) \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \left (2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-\sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \left (2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right )}+\frac {2 a^{2} A \left (24 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-12 \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-24 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+12 \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-3 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right ) \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}{5 \left (8 \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-12 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+6 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \sin \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}\right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) | \(723\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.12, size = 286, normalized size = 1.29 \begin {gather*} -\frac {5 \, \sqrt {2} {\left (i \, B a^{2} + 2 i \, A a b + 3 i \, B b^{2}\right )} \cos \left (d x + c\right )^{2} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + 5 \, \sqrt {2} {\left (-i \, B a^{2} - 2 i \, A a b - 3 i \, B b^{2}\right )} \cos \left (d x + c\right )^{2} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + 3 \, \sqrt {2} {\left (3 i \, A a^{2} + 10 i \, B a b + 5 i \, A b^{2}\right )} \cos \left (d x + c\right )^{2} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) + 3 \, \sqrt {2} {\left (-3 i \, A a^{2} - 10 i \, B a b - 5 i \, A b^{2}\right )} \cos \left (d x + c\right )^{2} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) - \frac {2 \, {\left (3 \, A a^{2} + 3 \, {\left (3 \, A a^{2} + 10 \, B a b + 5 \, A b^{2}\right )} \cos \left (d x + c\right )^{2} + 5 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}}}{15 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \left (A+B\,\cos \left (c+d\,x\right )\right )\,{\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^{7/2}\,{\left (a+b\,\cos \left (c+d\,x\right )\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________